<html>
<head>
<title>ThaiCreate.Com Tutorial</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<?
	$objConnect = mysql_connect("localhost","root","root") or die("Error Connect to Database");
	$objDB = mysql_select_db("appdrivergame");
	mysql_query("SET character_set_results=utf8");
	mysql_query("SET character_set_client=utf8"); 
    mysql_query("SET character_set_connection=utf8");
	$strSQL = "SELECT * FROM image WHERE id = '".$_GET["id"]."' ";
	$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
	$objResult = mysql_fetch_array($objQuery);
?>
	<form name="form1" method="post" action="PageUploadToMySQL5.php?FilesID=<?=$_GET["id"];?>" enctype="multipart/form-data">
	Edit Picture :<br>
    Picture : <input type="file" name="file"><br>
	<input type="hidden" name="hdnOldFile" value="<?=$objResult["image_path"];?>">
    <img src="../images/<?=$objResult["image_path"];?>"><br>
	Name : <input type="text" name="image_name" value="<?=$objResult["image_name"];?>"><br>
	
	
	<input name="btnSubmit" type="submit" value="Submit">
	</form>
 <?
	$objConnect = mysql_connect("localhost","root","root") or die("Error Connect to Database");
	$objDB = mysql_select_db("appdrivergame");
	mysql_query("SET character_set_results=utf8");
	mysql_query("SET character_set_client=utf8"); 
    mysql_query("SET character_set_connection=utf8");
	$strSQL = "SELECT * FROM image";
	$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
?>
<div class="table">	
<?
	$i=0;
	while($objResult = mysql_fetch_array($objQuery))
	{
		$i++;
?>
<div class="tr">
<div class="td"><?php echo "$i" ?></div>
<div class="td"><img src="../images/<?php echo $objResult["image_path"];?>" width="75" height="75"></div>
<div class="td"><?=$objResult["image_name"];?></center></td>
<div class="td"><a href="PageUploadToMySQL4.php?id=<?=$objResult["id"];?>">Edit</a></div>
<div class="td"><a href="JavaScript:if(confirm('Confirm Delete?')==true){window.location='PageDelete.php?id=<?php echo $objResult["id"];?>';}">Delete</a></div>
</div>

<?
	}
?>
</div>
<?
mysql_close($objConnect);
?>
    
</body>
</html>